/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbtipinf")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbtipinf.findAll", query = "SELECT p FROM Pydgtbtipinf p"),
    @NamedQuery(name = "Pydgtbtipinf.findByPydgtbtipinfid", query = "SELECT p FROM Pydgtbtipinf p WHERE p.pydgtbtipinfid = :pydgtbtipinfid"),
    @NamedQuery(name = "Pydgtbtipinf.findByNombre", query = "SELECT p FROM Pydgtbtipinf p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Pydgtbtipinf.findByObservaciones", query = "SELECT p FROM Pydgtbtipinf p WHERE p.observaciones = :observaciones")})
public class Pydgtbtipinf implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbtipinfid")
    private Integer pydgtbtipinfid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbtipinfid")
    private Collection<Pydgtbinf> pydgtbinfCollection;

    public Pydgtbtipinf() {
    }

    public Pydgtbtipinf(Integer pydgtbtipinfid) {
        this.pydgtbtipinfid = pydgtbtipinfid;
    }

    public Pydgtbtipinf(Integer pydgtbtipinfid, String nombre, String observaciones) {
        this.pydgtbtipinfid = pydgtbtipinfid;
        this.nombre = nombre;
        this.observaciones = observaciones;
    }

    public Integer getPydgtbtipinfid() {
        return pydgtbtipinfid;
    }

    public void setPydgtbtipinfid(Integer pydgtbtipinfid) {
        this.pydgtbtipinfid = pydgtbtipinfid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pydgtbinf> getPydgtbinfCollection() {
        return pydgtbinfCollection;
    }

    public void setPydgtbinfCollection(Collection<Pydgtbinf> pydgtbinfCollection) {
        this.pydgtbinfCollection = pydgtbinfCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbtipinfid != null ? pydgtbtipinfid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbtipinf)) {
            return false;
        }
        Pydgtbtipinf other = (Pydgtbtipinf) object;
        if ((this.pydgtbtipinfid == null && other.pydgtbtipinfid != null) || (this.pydgtbtipinfid != null && !this.pydgtbtipinfid.equals(other.pydgtbtipinfid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbtipinf[ pydgtbtipinfid=" + pydgtbtipinfid + " ]";
    }
    
}
